package com.heyukun.hoj.judge.codesandbox;

import com.heyukun.hoj.judge.codesandbox.impl.exampleCodeSandBox;
import com.heyukun.hoj.judge.codesandbox.impl.remoteCodeSandBox;
import com.heyukun.hoj.judge.codesandbox.impl.thirdPartyCodeSandBox;

/**
 * 代码沙箱工厂
 */
public class CodeSandBoxFactory {

    public static CodeSandBox newInstance(String type){
        switch (type){
            case "example":
                return new exampleCodeSandBox();
            case "remote":
                return new remoteCodeSandBox();
            case "thirdParty":
                return new thirdPartyCodeSandBox();
            default:
                return new exampleCodeSandBox();
        }
    }
}
